<?php
	require_once "db_connection.php";
	$sql = mysql_query("SELECT
					city.cityid,
					city.cityname,
					country.countryname,
					country.countrycode,
					city.zipcode
					FROM
					city
					INNER JOIN country ON country.countryid = city.countryid ORDER BY country.countryname, city.cityname");	
						
	$acc_num = 0;
	$class_alternate = "";
	while($row = mysql_fetch_array($sql, MYSQL_ASSOC))
	{
		$acc_num=$acc_num+1;
		echo"<tr class='". $class_alternate ."'>
						<td>".$acc_num."</td>
						<td><b>" .$row['cityname']. "</b></td>
						<td>" .$row['countryname']. "</td>
						<td>" .$row['countrycode']. "</td>
						<td>" .$row['zipcode']. "</td>
						<td class='options-width'>
						<a href='' title='Edit' class='icon-1 info-tooltip'></a>
						<a href='delete_affiliate.php?id=".$row['cityid']."'  title='Delete' class='icon-2 info-tooltip'></a>
						<a href='' title='View' class='icon-5 info-tooltip'></a>
						</td>
					</tr> ";
		if($class_alternate==""){ $class_alternate="alternate-row";}
		else{$class_alternate="";}				
	}
?>
